from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext 
from product.models import Product, ProductAccessories

from django.contrib import auth



def producthome(request):
    prod_info= Product.objects.filter(active=True)

    return render_to_response('product_multi.html',{
        'prod_info': prod_info 
    }, context_instance=RequestContext(request))
    
    

def productsingle(request, slug,):
    prod_single= Product.objects.filter(active=True, slug=slug)
    access= ProductAccessories.objects.filter(active=True)
  
 
    return render_to_response('single-product.html',{
        'prod_single': prod_single,
        'access': access
    }, context_instance=RequestContext(request, slug,))